package com.glasses.primework;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;

@ManagedBean
public class MessageBean {
    private String text;
    
    public String getText() {
        return text;
    }
    
    public void setText(String text) {
        this.text = text;
    }
    
    public void doJob() {
        System.out.println("MessageBean.doJob() triggered!");
        
        FacesContext context = FacesContext.getCurrentInstance().getCurrentInstance();
        context.addMessage("taptap", new FacesMessage("Message One"));
        context.addMessage("taptap", new FacesMessage("Message Two"));
        context.addMessage("taptap", new FacesMessage("Message Three"));
    }
}
